package part3;

import java.util.Scanner;

public class part3_1 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        System.out.println("请输入字符串:");

        String str = sc.nextLine();

//toCharArray()方法将字符串转换为字符数组

        char[] chs = str.toCharArray();

        int bigNum = 0;

        int smallNum = 0;

        int numberNum = 0;

        int otherNum = 0;

        for(int i=0;i<chs.length;i++){

            if(chs[i]>='A'&&chs[i]<='Z'){

                bigNum++;

            }else if(chs[i]>='a'&&chs[i]<='z'){

                smallNum++;

            }else if(chs[i]>='0'&&chs[i]<='9'){

                numberNum++;

            }else{

                otherNum++;

            }

        }

        System.out.println("大写字母个数:"+bigNum+",小写字母个数:"+smallNum+",数字个数:"+numberNum+",其他字符个数:"+otherNum);

    }

}
